<!--

    Copyright © 2016-2024 The Thingsboard Authors

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<div #knobContainer class="tb-knob flex flex-col" [style.pointer-events]="ctx.isEdit ? 'none' : 'all'">
  <div class="flex flex-1 flex-col items-center justify-center">
    <div #knob class="knob">
      <div #knobValueContainer class="value-container flex flex-row items-center justify-center">
        <span #knobValue class="knob-value">{{ value }}</span>
      </div>
      <div class="canvas-background"></div>
      <canvas #canvasBar id="canvasBar"></canvas>
      <div #knobTopPointerContainer class="top-pointer-container">
        <div #knobTopPointer class="top-pointer"></div>
      </div>
      <div class="top"></div>
      <div #knobErrorContainer class="error-container flex flex-row items-center justify-center" [style.background]="error?.length ? 'rgba(255,255,255,0.25)' : 'none'">
        <span #knobError class="knob-error" [innerHTML]="error"></span>
      </div>
      <div #knobTitleContainer class="title-container flex flex-row items-center justify-center">
        <span #knobTitle class="knob-title">{{ title }}</span>
      </div>
      <div #knobMinmaxContainer class="minmax-container flex flex-row items-center justify-start">
        <span class="minmax-label">min</span>
        <span class="flex-1"></span>
        <span class="minmax-label">max</span>
      </div>
      <div #textMeasure id="text-measure"></div>
    </div>
  </div>
</div>
